<template>
  <div>
    <h1>defineExpose</h1>
    <input type="button" value="修改子组件里count" @click="changeSon">
    <Son ref="sonRef" ></Son>
  </div>
</template>

<script setup>
import {ref,onMounted} from "vue"
import Son from "./Son.vue";

let sonRef = ref(null);

console.log("sonRef",sonRef);

onMounted(()=>{
  console.log("父组件 sonRef.count",sonRef.value.count);
})

function changeSon(){
  sonRef.value.changeCount();
}



</script>

<style scoped>

</style>